<!DOCTYPE html>

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title></title>
    <script src="./js/vue.js"></script>
</head>

<body>
    <div id="app">
        <mycom>
            <template v-slot:main>我是头部内容</template>
            <template v-slot:header>我是中部内容</template>
            <template v-slot:footer>我是低部内容</template>
        </mycom>

    </div>
    <script>
        var component1={
            data(){
                return {
                    comdata:'你好插槽'
                }
            },
            template:`
            <div>
                <header>
                <slot name="header"></slot>    
                </header>
                <main>
                <slot name="main"></slot>                     
                </main>
                <footer>
                <slot name="footer"></slot>    
                </footer>
                
            </div>
            `

        }
        var vm = new Vue({
            el: '#app',
            data: {},
            methods: {},
            components:{
                mycom:component1
            }
        })
    </script>
</body>

</html>